<template>
  <div>
    <h1>Movie</h1>
    <p>count组件的num数据是:{{ num }}</p>
    <button @click="getMovieList">获取电影列表</button>
    <ul>
      <li v-for="item in movieList" :key="item.albumId">
        {{ item.albumName }}
      </li>
    </ul>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
  name: 'Movie',
});
</script>
<script lang="ts" setup>
import useCountState from '@/store/count';
import useMovieState from '@/store/movie';
import { storeToRefs } from 'pinia';

const countState = useCountState();
const movieState = useMovieState();

const { num } = storeToRefs(countState);
const { movieList } = storeToRefs(movieState);

const { getMovieList } = movieState;
</script>

<style lang="less" scoped></style>
